//---------------------------------------------------------------------------

#ifndef FormSellH
#define FormSellH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ExtCtrls.hpp>
#include <Buttons.hpp>
#include <DBGrids.hpp>
#include <Grids.hpp>
#include <DB.hpp>
#include <IBCustomDataSet.hpp>
#include <IBQuery.hpp>
#include <IBTable.hpp>
#include <IBUpdateSQL.hpp>
#include <DBCtrls.hpp>
#include <AppEvnts.hpp>
#include "class_TabCtrl.h"
#include "Valut_class.h"
#include <Dialogs.hpp>
#include <map>
#include "MyStringGrid.h"
//---------------------------------------------------------------------------
enum SellState {sstWork, sstAdd};
class TFSell : public TForm
{
__published:	// IDE-managed Components
        TPanel *Panel1;
        TPanel *Panel2;
        TBitBtn *BitBtn2;
        TStringGrid *SG;
        TLabel *Label1;
        TLabel *lSumm;
        TBitBtn *BitBtn1;
        TBitBtn *BitBtn3;
        TGroupBox *GroupBox1;
        TComboBox *ComboBox1;
        TLabel *Label2;
        TLabel *Label3;
        TLabel *Label4;
        TLabel *Label5;
        TEdit *Edit3;
        TLabel *Label6;
        TEdit *Edit4;
        TApplicationEvents *ApplicationEvents1;
        TLabel *Label7;
        TIBQuery *qAsk;
        TIBQuery *Ask;
        TIBQuery *Ask1;
        TComboBox *Edit1;
        TComboBox *Edit2;
        TLabel *Label8;
        void __fastcall FormCreate(TObject *Sender);
        void __fastcall SGKeyDown(TObject *Sender, WORD &Key,
          TShiftState Shift);
        void __fastcall ApplicationEvents1Message(tagMSG &Msg,
          bool &Handled);
        void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
        void __fastcall BitBtn1Click(TObject *Sender);
        void __fastcall BitBtn2Click(TObject *Sender);
        void __fastcall ComboBox1KeyPress(TObject *Sender, char &Key);
        void __fastcall Edit1KeyPress(TObject *Sender, char &Key);
        void __fastcall Edit3KeyPress(TObject *Sender, char &Key);
        void __fastcall Edit4KeyPress(TObject *Sender, char &Key);
        void __fastcall Edit1Change(TObject *Sender);
        void __fastcall BitBtn3Click(TObject *Sender);
        void __fastcall ComboBox1Change(TObject *Sender);
        void __fastcall SGDrawCell(TObject *Sender, int ACol, int ARow,
          TRect &Rect, TGridDrawState State);
        void __fastcall Edit2Change(TObject *Sender);
        void __fastcall Edit4Change(TObject *Sender);
private:	// User declarations
        TTabCtrl *Disp;
        SellState State;
        std::map<int, int> GridKey;
public:		// User declarations
        __fastcall TFSell(TComponent* Owner);
        void __fastcall ResetEdit();
        void __fastcall HideEdit();
        void __fastcall ShowEdit();
        void __fastcall TryPostEdit();
        void __fastcall PostData();
        void __fastcall ReloadGrid();
};
//---------------------------------------------------------------------------
extern PACKAGE TFSell *FSell;
//---------------------------------------------------------------------------
#endif
